package com.stlm2.dems.user.dao.impl;

import com.stlm2.dems.user.entity.AccountType;
import org.springframework.stereotype.Repository;

import com.stlm2.dems.user.entity.Account;
import com.stlm2.dems.user.dao.AccountDao;
import com.stlm2.core.base.impl.BaseDaoImpl;

import java.util.List;

@Repository("accountDao")
public class AccountDaoImpl extends BaseDaoImpl<Account> implements AccountDao {

    public  Account getByUserId(int userId){
        return selectOne("getByUserId",userId);
    }

    @Override
    public Account getByOwnerId(Integer userId) {
        if (userId <= 0)
            return null;
        return selectOne("getByOwnerId", userId);
    }

    @Override
    public Account getByIdForUpdate(Integer id) {
        if(id <= 0)
            return null;

        return selectOne("getByIdForUpdate", id);
    }


}